<template>

  <div class="common-layout">
    <el-container>
      <el-aside width="200px">
        <el-menu default-active="1" class="el-menu-vertical-demo">
          <el-menu-item @click="$router.push('/manage')" index="1" v-if="userStore.loginInfo.role == 2">
            <el-icon>
              <icon-menu/>
            </el-icon>
            <span>文章管理</span>
          </el-menu-item>
          <el-menu-item @click="$router.push('/manage/userManage')" index="2" v-if="userStore.loginInfo.role == 2">
            <el-icon>
              <icon-menu/>
            </el-icon>
            <span>用户管理</span>
          </el-menu-item>
          <el-menu-item index="3" @click="$router.push('/manage/adminManage')" v-else>
            <el-icon>
              <icon-menu/>
            </el-icon>
            <span>管理员管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <RouterView></RouterView>
      </el-main>
    </el-container>
  </div>
</template>

<script setup>
import {useUserStore} from "@/store/user";
const userStore = useUserStore()
</script>